import type { RouteRecordRaw } from "vue-router";

export const userRoutes: RouteRecordRaw[] = [
  {
    path: "/users/list",
    component: () => import("@/views/system/user/UserList.vue"),
    meta: {
      title: "用户管理",
      permission: "user:view",
    },
  },
  {
    path: "/users/create",
    component: () => import("@/views/system/user/UserForm.vue"),
    meta: {
      title: "创建用户",
      permission: "user:create",
    },
  },
  {
    path: "/users/:id/edit",
    component: () => import("@/views/system/user/UserForm.vue"),
    props: true,
    meta: {
      title: "编辑用户",
      permission: "user:edit",
    },
  },
  {
    path: "/users/:id/profile",
    component: () => import("@/views/system/user/UserProfile.vue"),
    props: true,
    meta: {
      title: "用户详情",
      permission: "user:view",
    },
  },

  // 角色管理相关路由
  {
    path: "/roles/list",
    component: () => import("@/views/system/role/RoleList.vue"),
    meta: {
      title: "角色管理",
      permission: "role:view",
    },
  },
  {
    path: "/roles/create",
    component: () => import("@/views/system/role/RoleForm.vue"),
    meta: {
      title: "创建角色",
      permission: "role:create",
    },
  },
  {
    path: "/roles/:id/edit",
    component: () => import("@/views/system/role/RoleForm.vue"),
    props: true,
    meta: {
      title: "编辑角色",
      permission: "role:edit",
    },
  },
  {
    path: "/roles/:id",
    component: () => import("@/views/system/role/RoleDetail.vue"),
    props: true,
    meta: {
      title: "角色详情",
      permission: "role:view",
    },
  },
  {
    path: "/permission/list",
    component: () => import("@/views/system/role/permission/list.vue"),
    props: true,
    meta: {
      title: "角色权限",
      permission: "role:edit",
    },
  },
  // 个人中心
  {
    path: "/account/profile",
    component: () => import("@/views/account/Profile.vue"),
    meta: {
      title: "个人资料",
    },
  },
  {
    path: "/account/security",
    component: () => import("@/views/account/Security.vue"),
    meta: {
      title: "安全设置",
    },
  },
];
